<template>
    <el-form ref="form" :model="curData" label-width="100px" :inline="true" status-icon>
        <el-form-item label="编码:" prop="code">
            {{curData.code}}
        </el-form-item>
        <el-form-item label="名称:" prop="name">
            {{curData.name}}
        </el-form-item>
        <el-form-item label="用户类型:" prop="type">
            <span v-for="(item,index) in userTypes" :label="item.label" :value="+item.value"
                           :key="index" v-if="curData.type == item.value">{{item.label}}</span>
        </el-form-item>
        <el-form-item label="状态:" prop="enabled">
            <span v-for="(item,index) in enableds" :label="item.label" :value="+item.value"
                           :key="index" v-if="curData.enabled == item.value">{{item.label}}</span>
        </el-form-item>
        <el-form-item class="formBtn">
            <el-button type="info" @click="handleCancel" size="medium">取消</el-button>
        </el-form-item>
    </el-form>
</template>

<script>
    import detailMixin from '@/mixins/detail.mixin'
    import {mapState, mapActions} from 'vuex'
    export default {
        data() {
            return {
            };
        },
        mixins: [detailMixin],
        computed: {
            ...mapState('dic', ['userTypes','enableds'])
        },
        methods: {
            ...mapActions('dic',['doUserTypesOfBasic','doEnabledOfBasic']),
        },
        mounted() {
            // 用户类型
            this.doUserTypesOfBasic(this.$appConstant.DIC_CODE.SYSTEM_USERTYPE);
            // 数据字典启停状态
            this.doEnabledOfBasic(this.$appConstant.DIC_CODE.SYSTEM_ENABLED);
        }
    };
</script>
<style scoped lang="less">
    @import "../../../assets/css/common.less";
</style>
